<%@ Page Language="VB" MasterPageFile="~/Default.master" Title="Untitled Page" %>

<%@ Import Namespace="ClubStarterKit.Data" %>
<script runat="server">

Protected Sub submit_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        ClubStarterKit.Web.Forum.Report(Integer.Parse(Request("messageid")), ReasonTXT.Text, Membership.GetUser(), CStr(Request("ReturnURL")))
        ReasonTXT.Enabled = False
        submit.Enabled = False
        Status.Text = "Thank you for reporting this message. We will moderate this post acordingly."
    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        If Request("reportid") Is Nothing Then
            If Request("messageid") Is Nothing Or Request("ReturnURL") Is Nothing Then
                Response.Redirect("~/forum/topics.aspx")
            Else
                Dim msg As New Messages(Messages.Columns.Id, Request("messageid"))
                MessageTitle.Text = msg.Subject
                MessageText.Text = msg.Body
            End If
        Else
            ClubStarterKit.Web.Forum.MarkReportAsResolved(CStr(Request("reportid")))
            Response.Redirect("~/forum/topics.aspx")
        End If
    End Sub
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div id="body">
    <div class="fullwidth">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <asp:UpdatePanel ID="UP1" runat="server">
            <ContentTemplate>
        <h2>Report Message</h2><br />
        You have requested that we view the following message and moderate the message because of its content. Please review the message and then kindly provide a reason for your report. Note that your submission is confidential and not even the moderator will know your identity.
        <br /><br />
        <asp:Label ID="MessageTitle" runat="server" Font-Bold="true" />
        <br />
        <div class="msgbody">
        <asp:Label ID="MessageText" runat="server" />
        </div>
        <br />
        Reason: 
        <br />
        <asp:TextBox ID="ReasonTXT" runat="server" TextMode="MultiLine" Rows="4" Width="354px" /><br />
        <br />
        <br />
        <Club:RolloverButton id="submit" runat="server" OnClick="submit_Click" Text="Submit" />
        <br /><asp:Label ID="Status" runat="server" />
        </ContentTemplate>
        </asp:UpdatePanel>
        <asp:UpdateProgress ID="upprog1" runat="server" AssociatedUpdatePanelID="UP1" DisplayAfter="200"><ProgressTemplate>
            <asp:Image ID="updateimg" runat="server" SkinID="loading" />
        </ProgressTemplate></asp:UpdateProgress>
    </div>
</div>
</asp:Content>